<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return CMap::mergeArray(
	require_once dirname(__FILE__).'/params.php',
	array(
	'basePath'=>dirname(__FILE__).DS.'..',
	'name'=>'Frontend Site',
	'theme'=>'default',
	'defaultController'=>'default',
	// preloading 'log' component
	'preload'=>array('log'),
	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
		'application.widgets.*',
	),
	'behaviors' => array('FrontendConfigBehavior'),
	'modules'=>array(
		// uncomment the following to enable the Gii tool
		/*
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'Enter Your Password Here',
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		),
		*/
	),

	// application components
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		// uncomment the following to enable URLs in path-format
		
		'urlManager'=>array(
			'urlFormat'=>'path',
			'rules'=>array(
				'<lang:\w{2}>'	=>	'default/index',
				'<lang:\w+>/<action:(login|logout|about|contact|home|guestbook)>' => 'default/<action>',
				'<lang:\w+>/<alias>'=>'default/page',
				'<lang:\w+>/<cat>/<alias>-<year:\d{4}><month:\d{2}><id>'=>'post/read',
				'<lang:\w+>/<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<lang:\w+>/<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<lang:\w+>/<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
			'urlSuffix'		=>	'.html',
			'showScriptName'=>false,
		),
		
		
		/* 'errorHandler'=>array(
			// use 'site/error' action to display errors
			'errorAction'=>'site/error',
		), */
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
	),

	// application-level parameters that can be accessed
)
);